﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace TGInspect
{
    static public class Contents
    {
        public const int UnitTime = 2;
        public const int InModuleNum = 1;
        public const int OutMoudleNum = 1;
    }

    public partial class MainForm : Form
    {
        Thread Seq;


        public MainForm()
        {
            InitializeComponent();


        }

        private bool InitSystem()
        {

            Seq = new Thread(new ThreadStart(Sequence));
            Seq.Start();

            return true;      
        }

        static void Sequence()
        {
            try
            {
                Thread.Sleep(10);
            }
            catch (ThreadAbortException)
            {
                Console.WriteLine("Thread Error");
            }
            
        }

        private void AutoButton_Click(object sender, EventArgs e)
        {
            InitSystem();
        }

        private void ExitButton_Click(object sender, EventArgs e)
        {
            DialogResult ret = 0;
            ret = MessageBox.Show("종료하시겠습니까?", "종료", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (ret == DialogResult.Yes)
            {
                Seq.Join();
                Application.Exit();
            }
        }

        
    }
}
